<?php

require_once('dbconnect.inc.php');
require_once('auth.inc.php');

$auth = new auth();

$auth->setDefRedir($_SERVER['PHP_SELF']);

$user = $auth->isauth($dbh,$_COOKIE, true);

if (!$user)
{
	header($auth->getAuthRedir());	
	$cookie = $auth->getCookie();
	setcookie($cookie['name'], $cookie['value']);
	exit();
}
?>